import axios from 'axios'
const httpHelper = {}
// const userapi = '/FeichengWeb/api/user'
// const apijob = '/ShixiWeb/api/job'
// 配置Vue插件
httpHelper.install = function fn(Vue) {
  // axios.defaults.baseURL = 'https://www.liufengtec.com/FeichengWeb/api/user/'
  axios.defaults.baseURL = `https://www.liufengtec.com`
  // axion 拦截器
  axios.interceptors.request.use(function (config) {
    if (config.url !== '/home') {
      config.headers.Authorization = localStorage.getItem('token')
    }
    // console.log('打印-Authorization: ',config)
    return config
  },function (error) {
    return Promise.reject(error)
  })
  Vue.prototype.$http = axios
}
export default httpHelper
